function avg_acc = gogo_ada(X1train, X2train, ytrain, gidtrain, n_tree)
%GOGO Summary of this function goes here
%   Detailed explanation goes here
    avg_acc = 0;
    for gid=1:3
        clear tr_data; clear tr_label;
        clear te_data; clear te_label;
        [tr_data, tr_label, te_data, te_label] = ...
            generate_data_hellinger(X1train, X2train, ytrain, gidtrain, gid);
        
        % normalize ???
        %[tr_data, norm_params] = norm_data(tr_data);
        %te_data= norm_data(te_data, norm_params);
        
        ada = fitensemble(tr_data,tr_label,'AdaBoostM1',n_tree,'Tree',...
                          'LearnRate', 0.1);
        r = ada.predict(te_data);
        avg_acc = avg_acc + sum(te_label==r)/1200 * 100;
        fprintf('Result for group %d as test: %f.\n', gid, sum(te_label==r)/1200*100);
    end
    avg_acc = avg_acc / 3;
end